﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<DIV class="widget-area" id="secondary" role="complementary">
	<ASIDE class="widget widget_recent_entries" id="recent-posts-2">
		<c:choose>
			<c:when test="${not empty sessionScope.init}">
				<c:forEach var="plugin" items="${sessionScope.init.plugins}">
					<c:choose>
						<c:when test="${plugin.isSystem==false}">
							<div class="widget-title">
								<h3>${plugin.pTitle}</h3>
								<p>${plugin.content}</p>
								<br />
							</div>
						</c:when>
						<c:otherwise>
							<c:choose>
								<c:when test="${plugin.pluginName eq 'types'}">
									<div class="widget-title">
										<h3>
											<c:out value="${plugin.pTitle}" />
										</h3>
										<ul>
											<c:forEach var="type" items="${sessionScope.init.types}">
												<li><a href="${rurl}/sort/${type.alias}">${type.typeName}</a>
												</li>
											</c:forEach>
										</ul>
									</div>
								</c:when>
							</c:choose>
						</c:otherwise>
					</c:choose>
				</c:forEach>
			</c:when>
		</c:choose>
 
		<script type="text/javascript">
		$(function(){
			
			/*多彩tag*/
			var tags_a = $("#tags").find("a");
			tags_a.each(function(){
				var x = 6;
				var y = 0;
				var rand = parseInt(Math.random() * (x - y + 1) + y);
				$(this).addClass("size"+rand);
			});
			
		});
		</script>		
		<style type="text/css">
			.taglist a{padding:0px;display:inline-block;white-space:nowrap;}
			a.size1{font-size:14px;padding:2px;color:#804D40;}
			a.size1:hover{color:#E13728;}
			a.size2{padding:2px;font-size:12px;color:#B9251A;}
			a.size2:hover{color:#E13728;}
			a.size3{padding:3px;font-size:14px;color:#C4876A;}
			a.size3:hover{color:#E13728;}
			a.size4{padding:1px;font-size:18px;color:#B46A47;}
			a.size4:hover{color:#E13728;}
			a.size5{padding:3px;font-size:16px;color:#E13728;}
			a.size5:hover{color:#B46A47;}
			a.size6{padding:2px;font-size:12px;color:#77625E}
			a.size6:hover{color:#E13728;}
		</style>
		<h3 class="widget-title">热门标签</h3>
		
		<div class="taglist" id="tags">
			<s:iterator value="%{#application.tags}">
				<a href="${home}/tag/<s:property value='name'/>" title="<s:property value='name'/>上共有(<s:property value='count'/>)文章"><s:property value='name'/></a>
			 </s:iterator>
		</div>
 		
 		<h3 class="widget-title">用户排行</h3>
			<s:iterator value="%{#application.users}">
 				<a href="${home}/u/<s:property value='userName'/>"><img alt="<s:property value='nickName'/>" width="40" height="40" src="${home}/upload/header/<s:property value="header"/>"></a>
			</s:iterator>
			
		<h3 class="widget-title">最新博客</h3>

		<ul>
			<s:iterator value="%{#application.reBlog.rows}">
				<li><a title="链向<s:property value="title"/>" href="${home}/u/<s:property value="userName"/>/blog/details?id=<s:property value="id"/>"
								target="_blank" rel="bookmark"><s:property value="title"/></a></li>
			</s:iterator>
		</ul>
		
		
	</aside>
</div>
